byte bcdToDec(byte val)
{
 return ( (val/16*10) + (val%16) );
}


void setClock(byte year,byte month,byte day,byte hour,byte minute,byte second,byte dow)
{
  RTC.stop();
  RTC.set(DS1307_SEC,second);//1
  RTC.set(DS1307_MIN,minute);//25
  RTC.set(DS1307_HR,hour);//8
  RTC.set(DS1307_DOW,dow);//5
  RTC.set(DS1307_DATE,day);//28
  RTC.set(DS1307_MTH,month);//10
  RTC.set(DS1307_YR,year);//11
  RTC.start();
}

void getClock()
{
   RTC.get(rtc,true);
   Serial.print(rtc[R_HRS]);
   Serial.print(":");
   Serial.print(rtc[R_MINS]);
   Serial.print(":");
   Serial.print(rtc[R_SECS]);
   Serial.print(" ");
   Serial.print(rtc[R_MONTH]);
   Serial.print("/");
   Serial.print(rtc[R_DATE]);
   Serial.print("/");
   Serial.print(rtc[R_YEAR]);
   Serial.println();
   for(int i=0; i<7; i++)
  {
    Serial.print(rtc[i]);
    Serial.print(" ");
  }
}




 // Serial.print(RTC.min_of_day(true));  
  //Serial.println();
  //RTC.get_data(data);
  //for(int i=0; i<56; i++)
  //{
    //Serial.print(data[i]);
    //Serial.print(" ");
  //}
  
 // Serial.print(RTC.get_sram_byte(29));
